<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
  <script>
     var str_1 = "HelloWorld";
	 //length 求字符串的长度
	 console.log("str_1.length = "+str_1.length);

	 //charAt(X) 求字符串指定位置的字符
	 console.log("str_1.charAt(5) = "+str_1.charAt(5));

	 //indexOf(X) 返回某个字符在字符串中的索引位置
	 var num = str_1.indexOf('W');
	 console.log("str_1.indexOf('W') = "+str_1.indexOf('W'));

	 //replace(x,y) 替换字符串中的字符
	 var str_2 = str_1.replace('W','w');
	 console.log("str_2 = "+str_2);

	 //split("") 将字符串分割为数组
	 var array = str_1.split("");
	 console.log("array = "+array);
	 for(var i=0;i<array.length;i++){
	   console.log(array[i]);
	 }
  </script>
</html>
